package org.mineground.commands.player;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandException;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class Cmds implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) throws CommandException {
	Player player = (Player) sender;

	if (args.length == 0) {
	    player.sendMessage(ChatColor.RED + "* Usage: /cmds <Builder/SBuilder/VIP>");
	    return true;
	}

	if (args[0].equalsIgnoreCase("builder")) {
	    player.sendMessage(ChatColor.GOLD + "------------------ Builder Commands -------------------");
	    player.sendMessage(ChatColor.RED + "* /players - Displays online players");
	    player.sendMessage(ChatColor.RED + "* /rules - Displays server rules");
	    player.sendMessage(ChatColor.RED + "* /me - Action message");
	    player.sendMessage(ChatColor.RED + "* /pvp <on/off> - Toggles Player vs Player");
	    player.sendMessage(ChatColor.RED + "* /warp create <name> - Creats a warp at your location");
	    player.sendMessage(ChatColor.RED + "* /warp list - Displays a list of all server warps");
	    player.sendMessage(ChatColor.RED + "* /tp <player> - Request to teleport to specified player");
	    player.sendMessage(ChatColor.RED + "* /tp <on/off> - Enable/Disable teleporting to you");
	    player.sendMessage(ChatColor.RED + "* /cprivate - Locks your Chests/Doors/Furnaces/etc");
	    player.sendMessage(ChatColor.GOLD + "-----------------------------------------------------");
	}

	else if (args[0].equalsIgnoreCase("sbuilder")) {
	    player.sendMessage(ChatColor.GOLD + "----------------- SBuilder Commands -------------------");
	    player.sendMessage(ChatColor.RED + "* /lb tool - Gives a wooden pickaxe to check block logs");
	    player.sendMessage(ChatColor.RED + "* /mc - Gives you a glass carpet under your feet");
            player.sendMessage(ChatColor.RED + "* /fly <on/off> - Double-tap space and fly like a bird!");
	    player.sendMessage(ChatColor.RED + "* /clearinventory - Clears your entire inventory");
	    player.sendMessage(ChatColor.RED + "* /stack - Stacks and organizes items in your inventory");
	    player.sendMessage(ChatColor.GOLD + "-----------------------------------------------------");
	}

	else if (args[0].equalsIgnoreCase("vip")) {
	    player.sendMessage(ChatColor.GOLD + "-------------------- VIP Commands --------------------");
	    player.sendMessage(ChatColor.RED + "* /tp <player> - Instantly teleport you to defined player");
	    player.sendMessage(ChatColor.RED + "* /time <day/night> - Changes the time for all players");
	    player.sendMessage(ChatColor.RED + "* /tomblist - Shows you a list of your current Tombstones");
	    player.sendMessage(ChatColor.RED + "* /tombfind - Points your compass to desired Tombstone");
	    player.sendMessage(ChatColor.GOLD + "-----------------------------------------------------");
	} else
	    player.sendMessage(ChatColor.RED + "* Usage: /cmds <Builder/SBuilder/VIP>");

	return true;
    }
}
